/* *****************************************************************************
 * JFab (http://code.google.com/p/jfab)
 * Copyright (c) 2011 JFab.org
 * Admin jfab@jeffreythompson.net
 *
 * See the file "LICENSE.txt" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 * *****************************************************************************/


package org.jfab.core.factory;

import org.jfab.core.collection.CommentList;
import org.jfab.core.model.CGEnumItem;


/**
 * Provides a enum item factory.
 */
public final class DefaultCGEnumItemFactory implements CGEnumItemFactory
{
    @Override public final CGEnumItem createEnumItem(String enumName)
    {
        CGEnumItem answer = new CGEnumItem();

        answer.setName(enumName);

        return answer;
    }

    @Override public final CGEnumItem createEnumItem(CommentList commentLines,
        String enumName, String parameters)
    {
        CGEnumItem answer = new CGEnumItem();

        if (commentLines != null)
        {
            answer.getCommentLines().addAll(commentLines);
        }

        answer.setName(enumName);
        answer.setParameters(parameters);

        return answer;
    }
}
